import 'package:sow_app_core/sow_app_core.dart';

class BookClassifyModel {
  int id;
  String name;
  String parentId;
  String parentName;
  BookClassifyModel.fromJson(e)
      : id = int.parse(e['id']),
        name = e['name'],
        parentId = e['parentId'] ?? '',
        parentName = e['parentName'] ?? '';
  toEntity() {
    return Classify(
        classifyId: id.toString(),
        classifyName: name,
        parentId: parentId,
        parentName: parentName);
  }

  toJson() =>
      {'id': id, 'name': name, 'parentId': parentId, 'parentName': parentName};
}
